//============================================================================
// Name        : Function1.cpp
// Author      : Anthony Varghese
// Version     :
// Copyright   : You are free to use this in any way
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cmath>
using namespace std;

#include "myfunctions.h"
int x;

int main() {
	cout << "Function1 program:" << endl << endl;
	srand( 105 );
	int y = 0;
	{
		x = rand() % 20 + 1;
		int y = rand() % 20 + 1;
		cout << "x is " << x << endl;
		cout << "y is " << y << endl;
	}
	double z = average( x, y);
	cout << "average is " << z << endl;

	return 0;
}

// definition of average function
double average(int x1, int x2){
	double z = static_cast<double>(x1 + x2 )/ 2.0;
	return z;
}
